import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import './directives'
let app = createApp(App)
app.directive('backcolor', {
    beforeMount(el, binding) {
      // el就是指令绑定时所在的元素
      // console.log(el);
      // binding是一个对象 对象中的value就是给指令的值
      // console.log(binding);
      let w = Math.random() * 300 + 50 // 随机一个尺寸出来
      el.style.width = w + 'px'
      el.style.height = w + 'px'
      el.style.background = binding.value

    },


    updated(el, binding) {
      // console.log(binding);
      el.style.background = binding.value
    },
})
app.use(store).use(router).mount('#app')
